package com.mdp.workflow.biz.ru.convert;

import com.mdp.workflow.biz.ru.vo.FlowActivityVo;
import org.flowable.engine.history.HistoricActivityInstance;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * BPM 活动 Convert
 *
 *@author 唛盟开源9哥
 */
@Mapper
public interface FlowActivityConvert {

    FlowActivityConvert INSTANCE = Mappers.getMapper(FlowActivityConvert.class);

    List<FlowActivityVo> convertList(List<HistoricActivityInstance> list);

    @Mappings({
            @Mapping(source = "activityId", target = "key"),
            @Mapping(source = "activityType", target = "type")
    })
    FlowActivityVo convert(HistoricActivityInstance bean);
}
